package com.supcon.exchangedata.repository.master;
import com.supcon.exchangedata.pojo.entity.oracle.CtGpsStatisitcInfo;
import com.supcon.exchangedata.pojo.entity.oracle.CtGpsStatisitcInfoHis;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @program: exchange-data
 * @description: gps数据
 * @author: cherubr.Sumin
 * @create: 2021-12-15 14:19
 **/
public interface SlaveCarGpsInfoHis extends JpaRepository<CtGpsStatisitcInfoHis,String> {


    public List<CtGpsStatisitcInfo> findByTypeAndAndLayerCode(Long type,String layerCode);

    @Transactional
    @Modifying(clearAutomatically = true)
    @Query("delete CtGpsStatisitcInfoHis ct where ct.type =?1 and ct.layerCode =?2")
    public Integer deleteByTypeAndLayerCodeDiy(Long type,String layerCode);

    public CtGpsStatisitcInfoHis findByTongId(String id);
}
